package com.sam.im.greendao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.sam.im.sms.entity.NumberEntity;
import com.sam.im.sms.entity.WNumberEntity;

import com.sam.im.greendao.NumberEntityDao;
import com.sam.im.greendao.WNumberEntityDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig numberEntityDaoConfig;
    private final DaoConfig wNumberEntityDaoConfig;

    private final NumberEntityDao numberEntityDao;
    private final WNumberEntityDao wNumberEntityDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        numberEntityDaoConfig = daoConfigMap.get(NumberEntityDao.class).clone();
        numberEntityDaoConfig.initIdentityScope(type);

        wNumberEntityDaoConfig = daoConfigMap.get(WNumberEntityDao.class).clone();
        wNumberEntityDaoConfig.initIdentityScope(type);

        numberEntityDao = new NumberEntityDao(numberEntityDaoConfig, this);
        wNumberEntityDao = new WNumberEntityDao(wNumberEntityDaoConfig, this);

        registerDao(NumberEntity.class, numberEntityDao);
        registerDao(WNumberEntity.class, wNumberEntityDao);
    }
    
    public void clear() {
        numberEntityDaoConfig.clearIdentityScope();
        wNumberEntityDaoConfig.clearIdentityScope();
    }

    public NumberEntityDao getNumberEntityDao() {
        return numberEntityDao;
    }

    public WNumberEntityDao getWNumberEntityDao() {
        return wNumberEntityDao;
    }

}
